<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>checked</title>
    <script src = 'jquery-1.12.4.min.js'></script>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .bord{
            border: 1px dashed #ee2602;
            width: 90%;
            margin: 20px auto;
        }
        .title{
            font-size: 20px;
            font-weight: bold;
            margin: 20px;
        }
        .introduce{
            font-size: 16px;
            margin: 0 0 20px 50px;
        }
        .red{
            color: red;
        }
    </style>
    <script>
        jQuery(function ($) {
            $('#mybtn').click(function () {
                $("input:checked").css({backgroundColor:'red'})
            })
        });
    </script>
</head>
<div>
    <div class="bord">
        <div class="title">checked</div>
        <div class="introduce">匹配所有选中的被选中元素(复选框、单选框等，不包括select中的option)</div>
    </div>
    <div class="bord">
        <div class="title">演示效果</div>
        <div class="introduce">
            <form>
                <input type="checkbox" name="newsletter" checked="checked" value="Daily" />
                <input type="checkbox" name="newsletter" value="Weekly" />
                <input type="checkbox" name="newsletter" checked="checked" value="Monthly" />
            </form>
        </div>
    </div>
    <div class="bord">
        <div class="title">代码</div>
        <div class="introduce">
            <pre>
&lt;div class="introduce"&gt;
    &lt;form&gt;
        &lt;input type="checkbox" name="newsletter" checked="checked" value="Daily"/&gt;
        &lt;input type="checkbox" name="newsletter" value="Weekly"/&gt;
        &lt;input type="checkbox" name="newsletter" checked="checked" value="Monthly"/&gt;
    &lt;/form&gt;
&lt;/div&gt;
</pre>
        </div>
    </div>
</div>
</body>
</html>